import i18n from '../../../../lang'
translate('Last week')
// alert(i18n.t)
export function translate(key) {
    alert( translate('Last week'))
    return i18n.t(key)
}
// 日期快捷选项
export const pickerOptions={
    shortcuts: [{
        // 最近一周
        // text: i18n.t('Last week'),
        text: translate('Last week'),
        onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
        }
    }, {
        // 最近一个月
        text: i18n.t('Last month'),
        onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
        }
    }, {
        // 最近三个月
        text: i18n.t('Last three months'),
        onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
        }
    }]
}
